var btn = document.querySelector('#button');
var target = decodeURIComponent(location.search.split('=')[1]);
btn.href=target;